store derivation
nix-instantiateの出力
λ nix-store --realiseするとstore derivation outputsになる
拡張子は.drv
参考
Nix Pills 6.2
Derivation|Nix入門
#WIP
https://nixos.org/manual/nix/stable/command-ref/nix-instantiate.html
https://stackoverflow.com/questions/31490262/what-is-the-purpose-of-nix-instantiate-what-is-a-store-derivation
https://gyazo.com/fbb90b5bb61bac3c9671ed8e6448a3f3 https://stackoverflow.com/a/58243537
store derivationsってなんやねんmrsekut.icon
うーん、普通のderivationとは別物7日mrsekut.icon
Nixのderivationをどのようにbuildするのかのspecのようなもの
「derivationとはstore derivationのこと」と説明されることもある ref
Nixのderivationをcompileすると.drvfileが生成される
Nix Pillsでは、「C言語における.oのようなもの」と説明されている
Nix Storeの中を眺めるといっぱいあるmrsekut.icon
順序的には
Nixのderivationをcompileして.drvfileを生成する
.drvfileをbuildすると、そこに書かれているoutput pathsに、目的のproductがinstallされる
$ nix show-derivation <path>で中身を見れる
code:例
$ nix show-derivation /nix/store/z3hhlxbckx4g3n9sw91nnvlkjvyw754p-myname.drv
{
"/nix/store/z3hhlxbckx4g3n9sw91nnvlkjvyw754p-myname.drv": {
"outputs": {
"out": {
"path": "/nix/store/40s0qmrfb45vlh6610rk29ym318dswdr-myname"
}
},
"inputSrcs": [],
"inputDrvs": {},
"platform": "mysystem",
"builder": "mybuilder",
"args": [],
"env": {
"builder": "mybuilder",
"name": "myname",
"out": "/nix/store/40s0qmrfb45vlh6610rk29ym318dswdr-myname",
"system": "mysystem"
}
}
}
.drvの項目
outputs
buildして生成されるproductらのpath
ここのpathにはまだなにもない
buildする前にpathが決まっている
なぜ?
https://nixos.org/guides/nix-pills/our-first-derivation.html#idm140737320455376
この辺に書いている
1回読んだがちゃんと理解できなかったのでまた読もうmrsekut.icon
inputDrvs
input derivationのlist
ここが空白の場合は、他のderivationに依存していないことを表す
ここにリストされるのもstore derivation
platform
x86_64-darwinなど
builder
Nixのbuilder
env
builderに渡される環境変数など